#include<iostream>
#include<string>
using namespace std;
#include<fstream>

class Person
{
public:
	char name[64];
	int age;
};


void test01()
{
	Person p = { "afnla",23 };

	ofstream ofs;

	ofs.open("file.txt", ios::out | ios::binary);

	ofs.write((const char *)&p, sizeof(Person));

	ofs.close();
}

int main()
{
	test01();

	system("pause");
	return 0;
}